package router

import (
	"jgt-oper/src/context"
	"jgt-oper/src/svc"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
)

// SvcUserMap 注册路由映射
func SvcUserMap(g *inject.Graph, r *gear.Router) {
	a := new(svc.User)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/users/:id", context.WrapContext(a.Get))
	r.Get("/user_types", context.WrapContext(a.QueryTypes))
}
